package cate.game.role.res.call.base;

import cate.game.role.Role;
import cate.game.role.res.call.CallBasePO;


public interface ICallExe<T extends CallBasePO> {

    default boolean callExe(Role role, CallProcessData processData, ICallHandler handler, CallBasePO basePO) {
        for (; processData.checkFinish(); processData.consumedTimes++) {
            handler.singleCallExe(role, processData, basePO);
            handler.singleCallAffect(role, processData, basePO);
        }
        return true;
    }

    /**
     * 需要调用哪些机制
     */
    default void modifyByMods(Role role, CallProcessData processData, ICallHandler handler, CallBasePO basePO) {
        handler.modifyByDifferentMod(role, processData, basePO);
    }

    void handleResult(Role role, CallProcessData processData, ICallHandler handler, CallBasePO po);

    T onGotPO(Role role);

}
